/*
 * @Author: szx
 * @Date: 2023-03-28 14:41:13
 * @LastEditTime: 2023-03-28 14:43:27
 * @Description:
 * @FilePath: \learn\fullstackopen\part1\part1\src\components\PersonForm.jsx
 */
const PersonForm = ({ addPerson, newName, handleNameChange, newNumber, handleNumberChange }) => (
    <form onSubmit={addPerson}>
        <div>
            name: <input value={newName} onChange={handleNameChange} />
        </div>
        <div>
            number: <input value={newNumber} onChange={handleNumberChange} />
        </div>

        <div>
            <button type="submit">add</button>
        </div>
    </form>
);

export default PersonForm;
